<template>
  <el-dialog :model-value="visible" :title="props.flag ? '新增' : '编辑'" width="500">
    <el-form :model="props.form">
      <el-form-item label="ID" :label-width="formLabelWidth" v-if="flag == false">
        <el-input v-model="props.form.id" autocomplete="off" :disabled="flag === false" />
      </el-form-item>
      <el-form-item label="学号" :label-width="formLabelWidth">
        <el-input v-model="props.form.stuNo" autocomplete="off" />
      </el-form-item>
      <el-form-item label="姓名" :label-width="formLabelWidth">
        <el-input v-model="props.form.stuName" autocomplete="off" />
      </el-form-item>
      <el-form-item label="班级" :label-width="formLabelWidth">
        <el-input v-model="props.form.className" autocomplete="off" />
      </el-form-item>
      <el-form-item label="状态" :label-width="formLabelWidth">
        <el-input
          v-model="props.form.status"
          autocomplete="off"
          placeholder="请输入数字，1：未毕业，2：返校重听，3：已就业,4:返回未就业,5:以往未就业"
        />
      </el-form-item>
      <el-form-item label="学院" :label-width="formLabelWidth">
        <el-input
          v-model="props.form.collegeid"
          autocomplete="off"
          placeholder="请输入数字，1：游戏学院，2：网站工程学院"
        />
      </el-form-item>
      <el-form-item label="城市" :label-width="formLabelWidth">
        <el-input v-model="props.form.workCity" autocomplete="off" />
      </el-form-item>
      <el-form-item label="来源" :label-width="formLabelWidth">
        <el-input v-model="props.form.origin" autocomplete="off" />
      </el-form-item>
    </el-form>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="cancel">取消</el-button>
        <el-button type="primary" @click="submit"> 提交 </el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script setup>
import { ref, defineEmits, defineProps } from 'vue'

const formLabelWidth = '140px'

const props = defineProps({
  visible: Boolean,
  flag: Boolean,
  form: Object
})

const emit = defineEmits(['update:visible', 'toworksubmit', 'toworkcancel'])

const cancel = () => {
  emit('update:visible', false)
  emit('toworkcancel')
}

const submit = () => {
  emit('update:visible', false)
  emit('toworksubmit')
}
</script>

<style scoped>
</style>